import React from 'react'
import { Link, Control,Route } from 'react-keeper'
import 'weui';

import imgSrc from '../../assets/icon/人员新增.png';
import imgSrc2 from '../../assets/icon/施工日志.png';
import imgSrc3 from '../../assets/icon/监理日志.png';

import { Tab,TabBarItem,TabBar,Page,Article,
  Panel,
  PanelHeader,
  PanelBody,
  PanelFooter,
  Gallery, GalleryDelete, Button, Icon,
  Cells,
  Cell,
  CellHeader,
  CellBody,
  CellFooter,
  Flex,
  FlexItem,
  Grids
} from  'react-weui/build/packages'

export default class GalleryInfo extends React.Component {
  constructor(props) {
    super(props);
    this.goHome = this.goHome.bind(this);
    this.state = {
    }
  }

  goHome() {
    Control.go(-1);
  }

  render() {
    const BackButtonStyle = {
      display: 'inline-block',
      width: 'auto',
      color: 'white',
      border: 'none',
      position: 'absolute',
      top: '-55px',
      left: '15px'
    }
    return (
      <Page className="engview" title="Gallery" subTitle="画廊，可实现上传图片的展示或幻灯片播放">

        <div
          style={{ padding: '0 15px'}}
        >
          <Button
            type="default"
            onClick={e=>this.setState({ showMultiple: true})}
          >
            图片预览{this.props.imgls.icon}123
          </Button>
        </div>

{/*        <Gallery src={imgSrc} show={this.state.showSingle}>
          <Button
            style={BackButtonStyle}
            onClick={e=>this.setState({ showSingle: false})}
            plain
          >
            返回
          </Button>

        </Gallery>*/}

        {/*<Gallery src={this.props.imgls.map(file=>file.icon)} show={this.state.showMultiple}>*/}
        {/*<Button*/}
          {/*style={BackButtonStyle}*/}
          {/*onClick={e=>this.setState({ showMultiple: false})}*/}
          {/*plain*/}
        {/*>*/}
          {/*返回*/}
        {/*</Button>*/}
      {/*</Gallery>*/}
        <Gallery src={[imgSrc, imgSrc2, imgSrc3]} show={this.state.showMultiple}>
          <Button
            style={BackButtonStyle}
            onClick={e=>this.setState({ showMultiple: false})}
            plain
          >
            返eng回
          </Button>

        </Gallery>
      </Page>



    )
  }
}

GalleryInfo.propTypes = {
  imgls: React.PropTypes.object.isRequired
}
